package com.pactera.elasticsearch.commons;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: pactera
 * @description: 分页查询结果封装
 * @author: EC_liqingdian
 * @create: 2019-07-17 11:20
 **/
public class Page<T> extends BaseObject {
    private static final long serialVersionUID = -339871896482994406L;
    /**
     * 当前页
     */
    private Long current;
    /**
     * 每页的数量
     */
    private Long size;
    /**
     * 总页数
     */
    private Long pages;
    /**
     * 总记录数
     */
    private Long total;
    /**
     * 结果集
     */
    private List<T> records;

    public Page() {
        this.current = 1L;
        this.size = 10L;
        this.pages = 0L;
        this.total = 0L;
        this.records = new ArrayList<>();
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getCurrent() {
        return current;
    }

    public void setCurrent(Long current) {
        this.current = current;
    }

    public Long getSize() {
        return size;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public Long getPages() {
        return pages;
    }

    public void setPages(Long pages) {
        this.pages = pages;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public List<T> getRecords() {
        return records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }
}
